import http from '@/http'
// 角色相关

// 获取角色列表
const getRolesList = (params) => {
  return http.get('v1/roles', { params })
}

// 添加角色
const addRole = (params) => {
  return http.post('v1/roles', params)
}

// 编辑角色
const editRole = ({ id, params }) => {
  return http.put(`v1/roles/${id}`, params)
}

// 删除角色
const deleteRole = (id) => {
  return http.delete(`v1/roles/${id}`)
}

// 获取所有角色
const getAllRole = (params) => {
  return http.get('v1/roles/all', { params })
}

export { getRolesList, addRole, editRole, deleteRole, getAllRole }